UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8nD+eadS7wMOZ0qIp4l+MpIU9JMxpd0Dg0aqlYLOCLs='
WHERE
key_id = 'cf3a5900877341d322d2775a95c1c964780464300bcecbe51c3a73a608fad2e0'
AND (
token = '8nD+eadS7wMOZ0qIp4l+MpIU9JMxpd0Dg0aqlYLOCLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)