UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FOnVRhEggrZdhOAemJuN1dRvbdIM6qLRewBTL1Hb2B8='
WHERE
key_id = '997788b52e4f9d18fe255f86c6dc23a3bbb8fa1c138b66a4245fbd79537b1e73'
AND (
token = 'FOnVRhEggrZdhOAemJuN1dRvbdIM6qLRewBTL1Hb2B8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)