UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd7Vwq97SLxpHFt7iXcGtyxzI8a15eH+nzcJQ12/rn5s='
WHERE
key_id = '0c05f903a94e3e9729e47cd64ae477ba8a20cd53a3f4ba4b4fafa6ea0b2a004b'
AND (
token = 'd7Vwq97SLxpHFt7iXcGtyxzI8a15eH+nzcJQ12/rn5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)