UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0MBmS+5pVflHsScnN8BK5OL9eqm2gW1h3WJfF5nMkzg=' 
WHERE 
  key_id = 'b6c46ca1a58e2429a9de528cbd0b33d38a0da4ff1989d93c99441ecfeecc8832' 
  AND (
    token = '0MBmS+5pVflHsScnN8BK5OL9eqm2gW1h3WJfF5nMkzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061