UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yqQ5qhUocykGYArLzPbLx9GgJLSZ/+cXLIT8TCMJ30o='
WHERE
key_id = '87811ff322a666ef97d1b072cdcba85512dfa6f46213ca1b1ffa8293c4d2ee8b'
AND (
token = 'yqQ5qhUocykGYArLzPbLx9GgJLSZ/+cXLIT8TCMJ30o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)