UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H1ySvX0tGoBQxuRh5Pq1Wg3MBpt0snsVLatVjMlSB1w=' 
WHERE 
  key_id = '923649d9735cc60ba938d563b2d724dc9a62a8cad32303e44dfdd71503d3d183' 
  AND (
    token = 'H1ySvX0tGoBQxuRh5Pq1Wg3MBpt0snsVLatVjMlSB1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054