UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G9Aqtf1xclqdqc/c49MdXUpVRsyw2aiH6OQjKJmOcl4='
WHERE
key_id = 'fb647b4809f219fd392d912c3e9505e7ef465d8c74347105f2e8ca1f01005065'
AND (
token = 'G9Aqtf1xclqdqc/c49MdXUpVRsyw2aiH6OQjKJmOcl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)