UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4MCeLB8fyCSrYhGXB/OI+I7FctwhTtNyPlJHD6EOjk='
WHERE
key_id = '5dd332b013cbaa83f5d788d9cba7da38a95df13340f27a52a892c1f3a7737a7c'
AND (
token = 's4MCeLB8fyCSrYhGXB/OI+I7FctwhTtNyPlJHD6EOjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)