UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mH0ws9Nbx23zp0w+UVMDO6rVQhN9zO4pcWCRzmH/oMg='
WHERE
key_id = 'd12cf30d5414932d3689994bfce1d663af9b226c402f8e0252e7238ed2ae2db6'
AND (
token = 'mH0ws9Nbx23zp0w+UVMDO6rVQhN9zO4pcWCRzmH/oMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)