UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q0wz7RVbV8E+nHv4U0D/vPLHd7q8J/pIelz+dTB9YaU='
WHERE
key_id = '122b1bc828d20418f06bda000edb8cd93b3ed29062f22675247ed3f5c3679c6e'
AND (
token = 'q0wz7RVbV8E+nHv4U0D/vPLHd7q8J/pIelz+dTB9YaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)