UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwxFV7cbd+/nlxXiJB2zrmCL9QMEANJvhYCAnPk22DM='
WHERE
key_id = '47d02ca81e5aa81e14ac4109c59141c9860fce6d905b2b8d0886d436090095a9'
AND (
token = 'uwxFV7cbd+/nlxXiJB2zrmCL9QMEANJvhYCAnPk22DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)