UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FBHsFLUp472+xyfZFBcvxK4r6P7fFmWX9HBCN3ISS6I=' 
WHERE 
  key_id = '39beee0b7bef7eed6206e0f8ca52bc0e381ac09f3a0d8d34a1659ad37f74ff81' 
  AND (
    token = 'FBHsFLUp472+xyfZFBcvxK4r6P7fFmWX9HBCN3ISS6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042