UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uGB2gunYVj4q1jTb+OZZo5Cno1i3EOXDmOFEvJJaYO0='
WHERE
key_id = '65080ebc534621427bd9f04656a87221eb1223e897b4c0c2eb319ab791b9af0c'
AND (
token = 'uGB2gunYVj4q1jTb+OZZo5Cno1i3EOXDmOFEvJJaYO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)