UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YBrkHxoH2+l9iDlmQDFYKeZq25bw+s3JXfX2InW3VuQ='
WHERE
key_id = '598b84c7e5678d795d52dba79b5c9124cbf6183e93473609bdbf7309323fdc43'
AND (
token = 'YBrkHxoH2+l9iDlmQDFYKeZq25bw+s3JXfX2InW3VuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)