UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FZ32FgGhSOPb9WmQp4vr9ark3tF5neeAYbZ05PeGoes='
WHERE
key_id = '8ecace73a77fc148a28cd7e67edfb2403a13a7c016051661cc1ad0de68972c4e'
AND (
token = 'FZ32FgGhSOPb9WmQp4vr9ark3tF5neeAYbZ05PeGoes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)