UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EjaLphbRTxbJgudd5wSrC63klUGSnUtlHQCOH4mIbZI='
WHERE
key_id = 'd00b93ee541bfecdfa917a7b09f9edf90f9dbf259062e52a9aeeb82e5a3015b9'
AND (
token = 'EjaLphbRTxbJgudd5wSrC63klUGSnUtlHQCOH4mIbZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)