UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WqsHqeAnYYUohOWSSwJeT03XcmUnpPrYh+mRJfbbKXA='
WHERE
key_id = '5fef15f71548615997d3b5d77a310e255e901397fcd4c11873ba30b92934a35b'
AND (
token = 'WqsHqeAnYYUohOWSSwJeT03XcmUnpPrYh+mRJfbbKXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)