UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JDlRXUAmajREYuRSiuJNFTRVQrcSGmYg983tbDJI1qw='
WHERE
key_id = '912fdc863e878d664805115a584ef6c4b5527c5d260aec2ae944b39ae5ab9743'
AND (
token = 'JDlRXUAmajREYuRSiuJNFTRVQrcSGmYg983tbDJI1qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)