UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BslrnEykWwoLShkFK5AEkbHgFOxM3tPOqXZLgbBEMFU='
WHERE
key_id = '7b0e138b800f785e2396c8903d7ed6b73912bfc347cdc00680dab956a3b1f78f'
AND (
token = 'BslrnEykWwoLShkFK5AEkbHgFOxM3tPOqXZLgbBEMFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)