UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aHVn7cVfJ6sSwpH/RhoPHTjdDGRkhO4egp3xy66jbWU=' 
WHERE 
  key_id = 'c3d5a7ddf822bc3d92e48e92b78f14d1385369f773ec2a83535e72e30edca957' 
  AND (
    token = 'aHVn7cVfJ6sSwpH/RhoPHTjdDGRkhO4egp3xy66jbWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054