UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVw5B/f+5PuZGeTPCnCMLuQq5VNuG64Se9BqTIP08mA=' 
WHERE 
  key_id = 'c4393128f0d63331773e093af81bcc6dd8c5e51c369943e999499c380dba72a5' 
  AND (
    token = 'LVw5B/f+5PuZGeTPCnCMLuQq5VNuG64Se9BqTIP08mA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022