UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+N9zDSB3pSwRNw8S+Bu3O3OOGDfGgx/HhPnGqdASyg='
WHERE
key_id = '3dfe1d82adb5a7ed7fbec3d35bc4b68533f1184957404f8a0781e50c9497f2cd'
AND (
token = 't+N9zDSB3pSwRNw8S+Bu3O3OOGDfGgx/HhPnGqdASyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)