UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iE8xKW9dgY2jif1o008FDfKmIPROc3fjrgAmY7pfTls='
WHERE
key_id = '2f20ec8b85016083282ea2817b67104e90a5bcb4a28c8783a0b3b956436f6975'
AND (
token = 'iE8xKW9dgY2jif1o008FDfKmIPROc3fjrgAmY7pfTls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)