UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '483HcRr2sKVEHN09QXiDYeCas1nvfDMDxi7uTnwO9as=' 
WHERE 
  key_id = '596dafc81e053abaa5ac4ec2d8743dd1cf068dbde71f0f0b1d1c109381f0d623' 
  AND (
    token = '483HcRr2sKVEHN09QXiDYeCas1nvfDMDxi7uTnwO9as=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012