UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 300, 
  token = '2HetX7vFntR4zD7MnS65ulOos8r+hl74qnFeebBAg9k=' 
WHERE 
  key_id = '183d8c0b003227b8949f290056da3d05a61fe0474281405d3325fa336297fec3' 
  AND (
    token = '2HetX7vFntR4zD7MnS65ulOos8r+hl74qnFeebBAg9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024