UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eyQ0PjksdJzfcvHYSWG1YWZrTGTT2VpPH1+7gnL/lqc='
WHERE
key_id = 'eaa125f36b2eb5603b80c8174cc8a3bb5df55c02f2a535ad5808d7fde077d6ff'
AND (
token = 'eyQ0PjksdJzfcvHYSWG1YWZrTGTT2VpPH1+7gnL/lqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)