UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lqd6QuxstlLIJxY4/EuYwduQ5EPZuK5AxKy4Vi8Fr/g=' 
WHERE 
  key_id = 'c538340f180b26ce1631a3f4b5463304d363c12cc7f9148122875449541e1e48' 
  AND (
    token = 'Lqd6QuxstlLIJxY4/EuYwduQ5EPZuK5AxKy4Vi8Fr/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045