UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/iXhJWOIU+6JPkDdK3j0ej0Emvn+WmhwixDlmbLOlAg='
WHERE
key_id = '842b81fca1fa7ab4775420a7c78e87f7f4d4bd6514ef1a9ca1118183fee1f9d7'
AND (
token = '/iXhJWOIU+6JPkDdK3j0ej0Emvn+WmhwixDlmbLOlAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)