UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4/H8NBI/LsAw65SYtyGDmtAHdVhC/bJ0h7GQW7OuKe8=' 
WHERE 
  key_id = 'a30743317c49d84cddf57f3dc04e12f6dc15adaedf85cac2362a53d6cf8094fb' 
  AND (
    token = '4/H8NBI/LsAw65SYtyGDmtAHdVhC/bJ0h7GQW7OuKe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016