UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zpLgfmFcpgLtK4OhCQghFjEaF/XND1l5chxOSqDQZOo='
WHERE
key_id = '3ad40ec7394e40087013f078801fa04602288943041b2ecd4e1a1f920d79b2ea'
AND (
token = 'zpLgfmFcpgLtK4OhCQghFjEaF/XND1l5chxOSqDQZOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)