UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w3ZZN1ua53RMgXOCFFoiqwZVDFbXnij1xIL3j7U+0NA='
WHERE
key_id = 'f7db1eeb306a6cde5b45ead90952c29dbaf629eed026a019f399caf8255f9d0e'
AND (
token = 'w3ZZN1ua53RMgXOCFFoiqwZVDFbXnij1xIL3j7U+0NA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)