UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SvgOAZztfMoOIYlTnXAwgDtXI5d/UVSBwsfykpoP6ss=' 
WHERE 
  key_id = '415b5ed8d8b9062e282da0190dad0150cd0bede20acc20bf5f961dd8c6c071f1' 
  AND (
    token = 'SvgOAZztfMoOIYlTnXAwgDtXI5d/UVSBwsfykpoP6ss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016