UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+mctWrSqlAAIebkH7voCF2H7oYj6uRAJ97xENJGaDoM='
WHERE
key_id = '05fb770e4b361df03b5a9be60a92df31504ef35df19c8c6984c838a3f7b1fb51'
AND (
token = '+mctWrSqlAAIebkH7voCF2H7oYj6uRAJ97xENJGaDoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)