UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5tkajSIftGbH76HSw1kKZHNMXEwxYbZuYy2IIsP2v0='
WHERE
key_id = '84b180aa0f3b1a8ee408e83ec6ab2fc48ea5db8fa7298d083cd24624c798f948'
AND (
token = 'l5tkajSIftGbH76HSw1kKZHNMXEwxYbZuYy2IIsP2v0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)