UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sJV6cpG+baLmP56/UIN8ImI6AKDHFol6GTMkV++iPt8='
WHERE
key_id = '4ac9925e216ccbb1305e9b34e5d97e0b9ebae68f75b470ff150a6db179c9e6ae'
AND (
token = 'sJV6cpG+baLmP56/UIN8ImI6AKDHFol6GTMkV++iPt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)