UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2H8sBAq9V+MUgkG33H9rCbBCW4JuHwjwbuF6JdqZoyQ=' 
WHERE 
  key_id = 'b1bb42032216cf402417205bfc78d78475b0e354f246d372f2f26d21788f4290' 
  AND (
    token = '2H8sBAq9V+MUgkG33H9rCbBCW4JuHwjwbuF6JdqZoyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056